package com.qing.demo.netty.demo1.aio.server;

import com.qing.demo.netty.demo1.aio.ChannelInitializer;

import java.nio.ByteBuffer;
import java.nio.channels.AsynchronousSocketChannel;
import java.nio.charset.Charset;
import java.util.concurrent.TimeUnit;

/**
 * @author caozhipeng
 * @date 2025/7/22
 */
public class AioServerChannelInitializer extends ChannelInitializer {

    @Override
    public void initChannel(AsynchronousSocketChannel channel) {
        channel.read(ByteBuffer.allocate(1024),10, TimeUnit.SECONDS,null,new AioServerHandler(channel, Charset.forName("utf-8")));
    }
}
